package com.wtc.homework;

/**
 * @author 马可
 * @version 1.0
 * 枚举类
 * 2023/5/11
 * IntelliJ IDEA
 */
public class Homework07 {
    public static void main(String[] args) {
        Color[] values = Color.values();
        for (Color value : values) {
            value.show();
        }
    }
}

enum Color implements ColorInter {
    RED(255, 0, 0), BLUE(0, 0, 255),
    BLACK(0, 0, 0), YELLOW(255, 255, 0),
    GREEN(0, 255, 0);
    private int redValue;
    private int blueValue;
    private int greenValue;

    Color(int redValue, int blueValue, int greenValue) {
        this.redValue = redValue;
        this.blueValue = blueValue;
        this.greenValue = greenValue;
    }

    @Override
    public void show() {
        System.out.println("属性值：" + redValue + "，" + greenValue + "，" + blueValue);
    }

//    @Override
//    public String toString() {
//        return "Color{" +
//                "redValue=" + redValue +
//                ", blueValue=" + blueValue +
//                ", greenValue=" + greenValue +
//                '}';
//    }
}

interface ColorInter {
    void show();
}